<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动</title>
    <style>
        /* 网页布局第一准则：多个块级元素纵向排列找标准流，多个块级元素横向排列找浮动 */
        .left,
        .right {
            width: 300px;
            height: 300px;
            background-color: pink;
            float: left;
        }
        .right{
            float: right;
        }
    </style>
</head>

<body>
    <div class="left">左</div>
    <div class="right">右</div>
</body>

</html>